<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改系统用户信息</title>

<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<style type="">
  .tip1{
    width: 485px;
    height: 260px;
    position: absolute;
    top: 10%;
    left: 30%;
    background: #fcfdfd;
    box-shadow: 1px 8px 10px 1px #9b9b9b;
    border-radius: 1px;
    behavior: url(js/pie.htc);
    display: none;
    z-index: 111111;
}
.sure1{
    width: 96px;
    height: 35px;
    line-height: 35px;
    color: #fff;
    background: url(../images/btnbg1.png) repeat-x;
    font-size: 14px;
    font-weight: bold;
    border-radius: 3px;
    cursor: pointer;
       margin-left: 60px;
}
</style>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">基础管理</em></li>
			<li><ema href="javascript:void">账号管理</em></li>
			<li><ema href="javascript:void">编辑账号</em></li>
		</ul>
	</div></br></br>
	<ul class="forminfo">
	<c:forEach items="${lists}" var="data">
			<input type="hidden" value="${data.sys_id}" id="sys_id"></input>
			<input type="hidden" value="${data.sys_role}" id="sys_role1"></input>
			<input type="hidden" value="${data.status}" id="status1"></input>
			
			<li><label>姓名</label>
			    <input  name="sys_name" value="${data.sys_name}"  type="text" class="dfinput"  style="width:800px;"/>
			</li>
	  <li>
	     <label>账号</label>
	     <input  name="sys_phone" value="${data.sys_phone}"  type="text" class="dfinput"  style="width:800px;"/>
      </li>
	 <li><label>密码</label>
	  <input  name="sys_password" value="${data.sys_password}"  type="text" class="dfinput"  style="width:800px;"/>
	 </li>
	   <li><label>授权角色</label>
	      <select name="sys_role" id="sys_role" class="dfinput" >
		                    <option value="">请选择</option>
							<c:forEach items="${roles}" var="roles">
								<option value="${roles.role_id}">${roles.role_name}</option>
							</c:forEach>
		 </select>
	  </li>
    	 <li><label>状态</label>
    	 <select name="status" id="status" class="dfinput" >
		                    <option value="1">启用</option>
							<option value="2">禁用</option>
		 </select>
    	 </li>
	</c:forEach>
    </ul>
    <div style="margin-left:400px;"><input name="" type="button" class="tijiao" value="提交" style="width:96px; height:35px; line-height:35px; color:#fff; background:red; font-size:14px; font-weight:bold;border-radius: 3px; cursor:pointer;"/>
    &nbsp;<input name="quxiao" type="button" class="cancel" value="取消" /></div>
   	<div class="tip">
		<div class="tiptop">
			<span>提示信息</span>
		</div>
		<div class="tipinfo">
			<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
			<div class="tipright">
				<p>修改成功!</p>
				<cite>点击确定返回系统用户列表 。</cite>
			</div>
		</div>
		<div class="tipbtn">
			<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
		</div>
	</div>
	<div class="tip1">
		<div class="tiptop">
			<span>提示信息</span>
		</div>
		<div class="tipinfo">
			<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
			<div class="tipright">
				<p>账号已被使用，请换一个账号!</p>
			</div>
		</div>
		<div class="tipbtn">
			<input name="" type="button" class="sure1" value="确定"/>&nbsp;
		</div>
	</div>
    <script type="text/javascript">
    	$(function(){
    		$('#sys_role').val($('#sys_role1').val());
    		$('#status').val($('#status1').val());
    		$(".tijiao").click(function(){
    			var sys_name = $("input[name=sys_name]").val();
    			var sys_password = $("input[name=sys_password]").val();
    			var sys_phone = $("input[name=sys_phone]").val();
    			var status=$('#status').val();
    			var sys_role=$('#sys_role').val();
    			if(sys_name == null || sys_name == "" || sys_password == null || sys_password == "" || sys_phone == null || sys_phone == "" || 
    				sys_role==null ||sys_role==""){
    				return;
    			}
   	    		$.ajax({
   	   				type:"post",
   	   				url:"/htx-backer/sysUser/updateSysUser", 
   	   				data:{
   	   				sys_id:$("#sys_id").val(),
   	   				sys_password:sys_password,
   	   			    sys_name:sys_name,
   	   				sys_phone:sys_phone,
   	   				status:status,
   	   			    sys_role:sys_role
   	   				},
   	   				dataType:"json",
   	   				success:function(data){
   	   					var flag = data.flag;
   	   					if(flag == 1){
   	   						$(".tip").fadeIn(200);
   	   					}else if(flag == 3){
   	   					$(".tip1").fadeIn(200);
   	   					}
   	   				}
   				})
    		})
    		
	   		$(".sure").click(function(){
	   			window.location.href="/htx-backer/sysUser/sysUserList";
	   		});
	
	   		$(".cancel").click(function(){
	   			$(".tip").fadeOut(100);
	   		});
	   		$(".sure1").click(function(){
	   			$(".tip1").fadeOut(100);
	   		});
	   		
			$("input[name=quxiao]").click(function(){
	   			window.location.href="/htx-backer/sysUser/sysUserList";
	   		});
    	})
    </script>
</body>
</html>
